package com.lagou.edu.utils;

import com.lagou.edu.annotation.AnnotationApplicationContext;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class AnnotationListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        AnnotationApplicationContext annotationApplicationContext = new AnnotationApplicationContext("com.lagou.edu");
        servletContextEvent.getServletContext().setAttribute("WebApplicationContext",annotationApplicationContext);
    }
    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}
